/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #0c1426 0%, #1a2332 50%, #0f1419 100%);
    color: #ffffff;
    overflow-x: hidden;
}

.dashboard-container {
    min-height: 100vh;
    padding: 20px;
}



/* 动画效果 */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes numberCount {
    from {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    to {
        transform: scale(1);
    }
}



/* 响应式设计 */


/* 大屏容器 */
.dashboard-container {
    padding: 20px;
    max-width: 1920px;
    margin: 0 auto;
    min-height: 100vh;
}

/* 头部样式 */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 25px;
}

.dashboard-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(45deg, #4facfe 0%, #00f2fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.dashboard-header h1 i {
    margin-right: 15px;
    color: #4facfe;
}

.header-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.time {
    font-size: 1.5rem;
    font-weight: 600;
    color: #4facfe;
}

.date {
    font-size: 1rem;
    color: #8b9bb4;
}

/* 工厂总览样式 */
.factory-overview {
    margin-bottom: 30px;
}

.overview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 18px 22px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
}

.overview-header h2 {
    font-size: 1.5rem;
    color: #4facfe;
    display: flex;
    align-items: center;
    gap: 10px;
}

.overview-stats {
    display: flex;
    gap: 15px;
}

.stat-item {
    text-align: center;
    padding: 10px 15px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    min-width: 80px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.stat-item:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.05) 100%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 6px;
    font-weight: 500;
}

.stat-value {
    display: block;
    font-size: 1.6rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.stat-value.success {
    color: #4ade80;
    text-shadow: 0 1px 3px rgba(74, 222, 128, 0.3);
}

.stat-value.warning {
    color: #fbbf24;
    text-shadow: 0 1px 3px rgba(251, 191, 36, 0.3);
}

.stat-value.error {
    color: #f87171;
    text-shadow: 0 1px 3px rgba(248, 113, 113, 0.3);
}

/* 工厂网格样式 */
.factory-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
}

.factory-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
    border-radius: 14px;
    padding: 25px 28px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.factory-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4facfe, #00f2fe);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.factory-card:hover::before {
    opacity: 1;
}

.factory-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.15);
}

.factory-card.normal::before {
    background: linear-gradient(90deg, #28a745, #20c997);
    opacity: 0.7;
}

.factory-card.warning::before {
    background: linear-gradient(90deg, #ffc107, #fd7e14);
    opacity: 0.7;
}

.factory-card.error::before {
    background: linear-gradient(90deg, #dc3545, #fd7e14);
    opacity: 0.7;
}

.factory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}

.factory-name {
    font-size: 1.4rem;
    font-weight: 600;
    color: #4facfe;
}

.factory-status {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.factory-status.normal {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.factory-status.warning {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
    animation: pulse 2s infinite;
}

.factory-status.error {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.3);
    animation: pulse 1s infinite;
}

.factory-info {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
    flex: 1;
}

.factory-info-item {
    text-align: center;
    padding: 10px 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
}

.factory-info-item:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.12);
}

.factory-info-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 4px;
}

.factory-info-label {
    font-size: 0.75rem;
    color: #8b9bb4;
}

/* 车间详情样式 */
.workshop-detail {
    margin-bottom: 30px;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    padding: 18px 22px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    flex-wrap: wrap;
    backdrop-filter: blur(10px);
}

.back-btn {
    background: rgba(79, 172, 254, 0.2);
    border: 1px solid rgba(79, 172, 254, 0.3);
    color: #4facfe;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.back-btn:hover {
    background: rgba(79, 172, 254, 0.3);
    transform: translateY(-2px);
}

.detail-header h2 {
    font-size: 1.5rem;
    color: #4facfe;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

/* 车间选择器样式 */
.workshop-selector {
    margin-left: auto;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);
    border-radius: 10px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
}

.workshop-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.workshop-tab {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
    color: #8b9bb4;
    white-space: nowrap;
    backdrop-filter: blur(6px);
}

.workshop-tab:hover {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.12) 0%, rgba(79, 172, 254, 0.06) 100%);
    border-color: rgba(79, 172, 254, 0.25);
    color: #4facfe;
    transform: translateY(-1px);
}

.workshop-tab.active {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.2) 0%, rgba(79, 172, 254, 0.1) 100%);
    border-color: #4facfe;
    color: #4facfe;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(79, 172, 254, 0.2);
}

/* 核心指标区域 */
.core-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 25px;
    margin-bottom: 30px;
}

.metric-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
    border-radius: 14px;
    padding: 22px 25px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4facfe, #00f2fe);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.metric-card:hover::before {
    opacity: 1;
}

.metric-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.15);
}

.metric-card h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: #4facfe;
    display: flex;
    align-items: center;
    gap: 10px;
}

.metric-card h3 {
    font-size: 1.1rem;
    margin: 20px 0 15px 0;
    color: #8b9bb4;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.drill-down-btn {
    background: rgba(79, 172, 254, 0.2);
    border: 1px solid rgba(79, 172, 254, 0.3);
    color: #4facfe;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.drill-down-btn:hover {
    background: rgba(79, 172, 254, 0.3);
    transform: translateY(-1px);
}

/* 订单指标样式 */
.metric-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.metric-item {
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
}

.metric-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.metric-item.warning {
    background: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(255, 193, 7, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0); }
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 5px;
}

.metric-item.warning .metric-value {
    color: #ffc107;
}

.metric-label {
    font-size: 0.9rem;
    color: #8b9bb4;
}

/* 订单进度条样式 */
.progress-list {
    max-height: 200px;
    overflow-y: auto;
}

.order-progress-item {
    margin-bottom: 15px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border-left: 4px solid #28a745;
    transition: all 0.3s ease;
    cursor: pointer;
}

.order-progress-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
}

.order-progress-item.delayed {
    border-left-color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
}

.order-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.order-id {
    font-weight: 600;
    color: #4facfe;
}

.order-status {
    color: #8b9bb4;
}

.order-status.delayed {
    color: #dc3545;
    font-weight: 600;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-fill.delayed {
    background: linear-gradient(90deg, #dc3545, #fd7e14);
}

/* 生产状况样式 */
.production-overview {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.production-lines {
    flex: 2;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.production-line {
    aspect-ratio: 1.2;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    padding: 8px;
}

.production-line::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.05);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.production-line:hover::before {
    opacity: 1;
}

.production-line.normal {
    background: rgba(40, 167, 69, 0.2);
    border-color: #28a745;
    color: #28a745;
}

.production-line.warning {
    background: rgba(255, 193, 7, 0.2);
    border-color: #ffc107;
    color: #ffc107;
    animation: pulse 2s infinite;
}

.production-line.error {
    background: rgba(220, 53, 69, 0.2);
    border-color: #dc3545;
    color: #dc3545;
    animation: pulse 1s infinite;
}

.production-line:hover {
    transform: scale(1.05);
}

.line-number {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 5px;
    z-index: 1;
    text-align: center;
    word-break: break-all;
    line-height: 1.2;
}

.oee-value {
    font-size: 0.85rem;
    z-index: 1;
    text-align: center;
}

.oee-summary {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.oee-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
}

.oee-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.oee-label {
    color: #8b9bb4;
    font-size: 0.9rem;
}

.oee-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: #4facfe;
}

/* 质量状况样式 */
.quality-overview {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.quality-item {
    text-align: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
}

.quality-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.quality-item.highlight {
    background: rgba(40, 167, 69, 0.1);
    border-color: rgba(40, 167, 69, 0.3);
}

.quality-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 5px;
}

.quality-item.highlight .quality-value {
    color: #28a745;
}

.quality-label {
    font-size: 0.9rem;
    color: #8b9bb4;
}

/* 详细数据区域 */
.detail-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.detail-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.detail-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4facfe, #00f2fe);
    opacity: 0.7;
}

.detail-card h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: #4facfe;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 异常事件列表 */
.event-list {
    max-height: 300px;
    overflow-y: auto;
}

.event-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border-left: 4px solid #ffc107;
    animation: slideIn 0.5s ease;
    transition: all 0.3s ease;
    cursor: pointer;
}

.event-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.event-item.error {
    border-left-color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
}

.event-item.success {
    border-left-color: #28a745;
    background: rgba(40, 167, 69, 0.1);
}

.event-icon {
    font-size: 1.2rem;
    color: #ffc107;
}

.event-item.error .event-icon {
    color: #dc3545;
}

.event-item.success .event-icon {
    color: #28a745;
}

.event-content {
    flex: 1;
}

.event-message {
    font-size: 0.9rem;
    color: #ffffff;
    margin-bottom: 3px;
}

.event-time {
    font-size: 0.8rem;
    color: #8b9bb4;
}

/* 不良品详情 */
.defect-details {
    max-height: 300px;
    overflow-y: auto;
}

.defect-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
}

.defect-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
}

.defect-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.defect-id {
    font-size: 0.9rem;
    font-weight: 600;
    color: #4facfe;
}

.defect-type {
    font-size: 0.8rem;
    color: #8b9bb4;
}

.defect-batch {
    font-size: 0.8rem;
    color: #8b9bb4;
}

/* 钻取弹窗样式 */
.drill-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.drill-modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.drill-content {
    background: rgba(26, 35, 50, 0.95);
    border-radius: 15px;
    padding: 30px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
}

.drill-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.drill-title {
    font-size: 1.5rem;
    color: #4facfe;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: #8b9bb4;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.close-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.drill-data {
    display: grid;
    gap: 20px;
}

.drill-section {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.drill-section h4 {
    color: #4facfe;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.drill-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.drill-table th,
.drill-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.drill-table th {
    background: rgba(79, 172, 254, 0.1);
    color: #4facfe;
    font-weight: 600;
}

.drill-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* 图表容器 */
.capacity-chart, .defect-analysis {
    margin-top: 20px;
}

canvas {
    max-height: 200px;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .core-metrics {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .detail-section {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .production-lines {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .factory-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .drill-content {
        width: 95%;
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .dashboard-container {
        padding: 10px;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .dashboard-header h1 {
        font-size: 2rem;
    }
    
    .overview-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .overview-stats {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .stat-item {
        padding: 8px 12px;
        min-width: 70px;
    }
    
    .stat-value {
        font-size: 1.4rem;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }
    
    .metric-grid, .quality-overview {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .production-overview {
        flex-direction: column;
    }
    
    .production-lines {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .production-line {
        aspect-ratio: 1.1;
        padding: 6px;
    }
    
    .line-number {
        font-size: 0.9rem;
    }
    
    .oee-value {
        font-size: 0.8rem;
    }
    
    .factory-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .factory-card {
        min-height: 240px;
        padding: 20px;
    }
    
    .factory-info {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .factory-info-item {
        padding: 10px 8px;
    }
    
    .factory-info-value {
        font-size: 1.1rem;
    }
    
    .factory-info-label {
        font-size: 0.7rem;
    }
    
    .drill-content {
        width: 98%;
        padding: 15px;
    }
    
    .drill-table {
        font-size: 0.9rem;
    }
    
    .drill-table th,
    .drill-table td {
        padding: 8px;
    }
    
    .detail-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .workshop-selector {
        margin-left: 0;
        width: 100%;
        max-width: 300px;
        align-self: center;
    }
    
    .workshop-tabs {
        justify-content: center;
    }
}

/* 数字动画样式 */
@keyframes numberPulse {
    0% {
        transform: scale(1);
        color: #ffffff;
    }
    50% {
        transform: scale(1.1);
        color: #4ade80;
    }
    100% {
        transform: scale(1);
        color: #ffffff;
    }
}

.number-animating {
    animation: numberPulse 0.8s ease-in-out;
}

/* 生产芯数增长动画效果 */
.chip-growth-animation {
    position: relative;
    overflow: hidden;
}

.chip-growth-animation::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(74, 222, 128, 0.3), transparent);
    animation: chipShine 2s ease-in-out;
}

@keyframes chipShine {
    0% {
        left: -100%;
    }
    50% {
        left: 100%;
    }
    100% {
        left: 100%;
    }
}

/* 数字滚动动画的过渡效果 */
.factory-info-value,
#total-tested {
    transition: all 0.3s ease;
}

.factory-info-value.changing,
#total-tested.changing {
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.1) 0%, rgba(74, 222, 128, 0.05) 100%);
    border-radius: 8px;
    padding: 4px 8px;
    margin: -4px -8px;
    box-shadow: 0 0 15px rgba(74, 222, 128, 0.3);
}
